﻿using System.Reflection;

namespace FrameworkCore.Modules;

/// <summary>
/// 实现此接口的类向引擎中的各种服务提供类型信息。
/// </summary>
public partial interface ITypeFinder
{
    /// <summary>
    /// 查找指定类型的类
    /// </summary>
    /// <typeparam name="T">类型</typeparam>
    /// <param name="onlyConcreteClasses">一个值，指示是否仅查找具体类</param>
    /// <returns>结果</returns>
    IEnumerable<Type> FindClassesOfType<T>(bool onlyConcreteClasses = true);

    /// <summary>
    /// 查找指定类型的类
    /// </summary>
    /// <param name="assignTypeFrom">从指定类型分配</param>
    /// <param name="onlyConcreteClasses">一个值，指示是否仅查找具体类</param>
    /// <returns>结果</returns>
    IEnumerable<Type> FindClassesOfType(Type assignTypeFrom, bool onlyConcreteClasses = true);

    /// <summary>
    /// 获取与当前实现相关的程序集。
    /// </summary>
    /// <returns>程序集列表</returns>
    IList<Assembly> GetAssemblies();

    /// <summary>
    /// 根据完整名称获取程序集
    /// </summary>
    /// <param name="assemblyFullName">程序集的完整名称</param>
    /// <returns>程序集</returns>
    Assembly GetAssemblyByName(string assemblyFullName);
}